package com.donleo.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.donleo.common.relation.RolePermissionRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 角色权限关联表 Mapper 接口
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
public interface RolePermissionRelationMapper extends BaseMapper<RolePermissionRelation> {

    /**
     * 根据角色编号和权限编号删除
     */
    int deleteByPmsCodes(@Param("list") List<String> subtract, @Param("roleCode") String roleCode);

    /**
     * 根据权限编号删除
     */
    int deletes(List<String> collect);

    /**
     * 批量插入权限
     */
    int insertBatch(@Param("list") List<RolePermissionRelation> strings1);

    /**
     * 根据角色编号查询
     */
    List<RolePermissionRelation> selectByRoleCodes(List<String> collect);

}
